package com.ss.android.account.b;

import android.content.Context;
import android.os.Message;
import com.bytedance.common.utility.collection.WeakList;
import com.bytedance.common.utility.collection.WeakHandler.Callback;
import com.bytedance.common.utility.collection.WeakHandler;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public abstract class i implements Callback {
    public final class i$a {
    }

    protected int a;
    protected final List b;
    private WeakList c;

    protected i(Context arg2) {

        new WeakHandler(((Callback)this));
        this.b = new ArrayList();
        arg2.getApplicationContext();
        this.c = new WeakList();
    }

    protected final void a() {
        this.b.clear();
        this.a = 0;
    }

    protected void a(int arg3, boolean arg4, i$a arg5) {
        if(arg3 == 0) {
            if(arg4) {
                this.c();
                if(this.a > this.b.size()) {
                    this.a = this.b.size();
                }

                this.b();
            }
            else {
                this.b();
            }
        }
    }

    protected final void b() {
        if(!this.c.weakHashMap.isEmpty()) {
            Iterator v0 = this.c.iterator();
            while(v0.hasNext()) {
                v0.next();
            }
        }
    }

    protected List c() {
        return null;
    }

    public void handleMsg(Message message) {
        boolean v1;
        int v2 = message.arg1;
        switch(message.what) {
            case 10: {
                v1 = true;
                if(!(message.obj instanceof i$a)) {
                    return;
                }

                this.a(v2, v1, ((i$a) message.obj));
            }
            case 11: {
                v1 = false;
            label_7:
                if(!(message.obj instanceof i$a)) {
                    return;
                }

                this.a(v2, v1, ((i$a) message.obj));
                break;
            }
        }
    }
}

